﻿using System.ComponentModel.DataAnnotations;

namespace Global.Validation
{
    public class EmailAttribute : RegularExpressionAttribute
    {
        public EmailAttribute() :
            base(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")
        { }

        public override string FormatErrorMessage(string name)
        {
            return string.Format("* 电子邮件格式不正确");
        }
    }
}